home *** CD-ROM | disk | FTP | other *** search
/ Young Minds / Young Minds Interactive CD-ROM.ISO / mpss / patch1 < prev    next >
Encoding:
Text File  |  1988-08-17  |  50.1 KB  |  1,696 lines

  1. [[            MPSS VERSION 1.4
  2. Hello Folks !
  3. Here is the, new, revised game. Hope it will go ok on your machine.
  4. Incase of any problems, mail me. This is Version 1.4. If you have 
  5. a lower or unmarked version of this game, replace it by this. It's worth it.
  6. Some bugs are fixed. Re-read the rules file. Still BSD Unix dependent.]]
  7.  
  8. #! /bin/sh
  9. # This is a shell archive.  Remove anything before this line, then unpack
  10. # it by saving it into a file and typing "sh file".  To overwrite existing
  11. # files, type "sh file -c".  You can also feed this as standard input via
  12. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  13. # will see the following message at the end:
  14. #        "End of shell archive."
  15. # Contents:  Patches01
  16. # Wrapped by billr@saab on Wed Aug 17 11:50:06 1988
  17. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  18. if test -f 'Patches01' -a "${1}" != "-c" ; then 
  19.   echo shar: Will not clobber existing file \"'Patches01'\"
  20. else
  21. echo shar: Extracting \"'Patches01'\" \(48433 characters\)
  22. sed "s/^X//" >'Patches01' <<'END_OF_FILE'
  23. X*** ../../mpss/aliens.c    Thu Jun 23 10:22:05 1988
  24. X--- aliens.c    Wed Jul 27 14:36:06 1988
  25. X***************
  26. X*** 1,3 ****
  27. X--- 1,18 ----
  28. X+ 
  29. X+ /********VERSION 1.4!!! (Files from different Versions are INCOMPATIBLE!*******/
  30. X+ /*******************************************************************************
  31. X+ ********************************************************************************
  32. X+ ********************************************************************************
  33. X+ 
  34. X+ PERMISSION TO COPY THIS SOFTWARE IS HEREBY GIVEN BY THE AUTHOR PROVIDED THAT
  35. X+ THIS LEADING MESSAGE IS INCLUDED IN ALL OF THE RELEVANT SOURCE FILES.
  36. X+ 
  37. X+         P. SCHMITZ, UNIVERSITY OF KEELE, MAY 1988.
  38. X+ 
  39. X+ 
  40. X+ ********************************************************************************
  41. X+ ********************************************************************************
  42. X+ *******************************************************************************/
  43. X  #include "ships.h"
  44. X  #include "header.h"
  45. X  
  46. X***************
  47. X*** 89,96 ****
  48. X              i=rand()%100;
  49. X              if (i<6)
  50. X                  {
  51. X!                 fire_torpedo(cp,'6',0);
  52. X                  cp->messindex=0;
  53. X                  i=rand()%100;
  54. X                  if (i<50)
  55. X                      cp->yvel=1;
  56. X--- 104,117 ----
  57. X              i=rand()%100;
  58. X              if (i<6)
  59. X                  {
  60. X!                 if (cp->planets[1]!=0)
  61. X!                     {
  62. X!                     fire_torpedo(cp,'9',0);
  63. X!                     fire_torpedo(cp,'9',0);
  64. X!                     } else
  65. X!                     fire_torpedo(cp,'6',0);
  66. X                  cp->messindex=0;
  67. X+                 cp->planets[1]=0;
  68. X                  i=rand()%100;
  69. X                  if (i<50)
  70. X                      cp->yvel=1;
  71. X***************
  72. X*** 100,107 ****
  73. X              i=rand()%100;
  74. X              if (i<6)
  75. X                  {
  76. X!                 fire_torpedo(cp,'4',0);
  77. X                  cp->messindex=0;
  78. X                  i=rand()%100;
  79. X                  if (i<50)
  80. X                      {
  81. X--- 121,134 ----
  82. X              i=rand()%100;
  83. X              if (i<6)
  84. X                  {
  85. X!                 if (cp->planets[1]!=0)
  86. X!                     {
  87. X!                     fire_torpedo(cp,'7',0);
  88. X!                     fire_torpedo(cp,'7',0);
  89. X!                     } else
  90. X!                     fire_torpedo(cp,'4',0);
  91. X                  cp->messindex=0;
  92. X+                 cp->planets[1]=0;
  93. X                  i=rand()%100;
  94. X                  if (i<50)
  95. X                      {
  96. X***************
  97. X*** 140,146 ****
  98. X  register struct player *x;
  99. X  if (noofplayers>1) return(0);
  100. X  x=startlist;
  101. X! while (x!=NULL && x->id!=enemyid) x=x->next;
  102. X  if (x!=NULL) lockonalien(x,who);
  103. X  }
  104. X  
  105. X--- 167,173 ----
  106. X  register struct player *x;
  107. X  if (noofplayers>1) return(0);
  108. X  x=startlist;
  109. X! while (x!=NULL && (x->id!=enemyid || x->messindex==1)) x=x->next;
  110. X  if (x!=NULL) lockonalien(x,who);
  111. X  }
  112. X  
  113. X***************
  114. X*** 153,158 ****
  115. X--- 180,195 ----
  116. X  
  117. X  i=rand()%1000;
  118. X  if (i>500) cp->weaponselect=0; else cp->weaponselect=1;
  119. X+ if (i>500)
  120. X+     {
  121. X+     if (i>750) cp->screenenergy=6; else cp->screenenergy=7;
  122. X+     } else
  123. X+     {
  124. X+     if (i>250) cp->screenenergy=5; else cp->screenenergy=8;
  125. X+     }
  126. X+ i=rand()%100;
  127. X+ if (i>30) cp->planets[1]=0; else
  128. X+     cp->planets[1]=abs((rand()%10)-5);
  129. X  if (who==NULL)
  130. X      {
  131. X      x=startlist;
  132. X***************
  133. X*** 180,201 ****
  134. X  autopilotalien(cp)
  135. X  register struct player *cp;
  136. X  {
  137. X  if (cp->weaponselect==0)
  138. X      {
  139. X!     if (cp->xpos!=(cp->channel[1].enemy->xpos-7))
  140. X          {
  141. X!     if (cp->xpos<(cp->channel[1].enemy->xpos-7)) cp->xvel=1; else cp->xvel= -1;
  142. X          } else cp->xvel=0;
  143. X      } else
  144. X      {
  145. X!     if (cp->xpos!=(cp->channel[1].enemy->xpos+6))
  146. X          {
  147. X!     if (cp->xpos<(cp->channel[1].enemy->xpos+6)) cp->xvel=1; else cp->xvel= -1;
  148. X          } else cp->xvel=0;
  149. X      }
  150. X! if (cp->ypos!=cp->channel[1].enemy->ypos)
  151. X          {
  152. X!     if (cp->ypos<cp->channel[1].enemy->ypos) cp->yvel=1; else cp->yvel= -1;
  153. X          } else cp->yvel=0;
  154. X  
  155. X  /* arrival at location*/
  156. X--- 217,240 ----
  157. X  autopilotalien(cp)
  158. X  register struct player *cp;
  159. X  {
  160. X+ int g;
  161. X+ g = cp->planets[1];
  162. X  if (cp->weaponselect==0)
  163. X      {
  164. X!     if (cp->xpos!=(cp->channel[1].enemy->xpos-cp->screenenergy))
  165. X          {
  166. X!     if (cp->xpos<(cp->channel[1].enemy->xpos-cp->screenenergy)) cp->xvel=1; else cp->xvel= -1;
  167. X          } else cp->xvel=0;
  168. X      } else
  169. X      {
  170. X!     if (cp->xpos!=(cp->channel[1].enemy->xpos+cp->screenenergy))
  171. X          {
  172. X!     if (cp->xpos<(cp->channel[1].enemy->xpos+cp->screenenergy)) cp->xvel=1; else cp->xvel= -1;
  173. X          } else cp->xvel=0;
  174. X      }
  175. X! if (cp->ypos!=(cp->channel[1].enemy->ypos-g))
  176. X          {
  177. X!     if (cp->ypos<(cp->channel[1].enemy->ypos-g)) cp->yvel=1; else cp->yvel= -1;
  178. X          } else cp->yvel=0;
  179. X  
  180. X  /* arrival at location*/
  181. X*** ../../mpss/auto.c    Thu Jun 23 10:22:05 1988
  182. X--- auto.c    Wed Jul 27 14:36:06 1988
  183. X***************
  184. X*** 1,3 ****
  185. X--- 1,5 ----
  186. X+ 
  187. X+ /********VERSION 1.4!!! (Files from different Versions are INCOMPATIBLE!*******/
  188. X  /*******************************************************************************
  189. X  ********************************************************************************
  190. X  ********************************************************************************
  191. X*** ../../mpss/collision.c    Thu Jun 23 10:22:05 1988
  192. X--- collision.c    Wed Jul 27 14:36:06 1988
  193. X***************
  194. X*** 1,4 ****
  195. X--- 1,5 ----
  196. X  
  197. X+ /********VERSION 1.4!!! (Files from different Versions are INCOMPATIBLE!*******/
  198. X  /*******************************************************************************
  199. X  ********************************************************************************
  200. X  ********************************************************************************
  201. X***************
  202. X*** 14,19 ****
  203. X--- 15,36 ----
  204. X  *******************************************************************************/
  205. X  #include "header.h"
  206. X  
  207. X+ bounceplayer(cp)
  208. X+ register struct player *cp;
  209. X+ {
  210. X+     if (cp->xvel<0) cp->xvel=1; 
  211. X+     else
  212. X+         {
  213. X+         if (cp->xvel>0) cp->xvel= -1;
  214. X+         }
  215. X+     if (cp->yvel<0) cp->yvel=1;
  216. X+     else
  217. X+         {
  218. X+         if (cp->yvel>0) cp->yvel= -1;
  219. X+         }
  220. X+     plotvelocity(cp);
  221. X+ }
  222. X+ 
  223. X  collision(cp,c)
  224. X  register struct player *cp;
  225. X  char c;
  226. X***************
  227. X*** 35,55 ****
  228. X      }
  229. X  case 'O' :
  230. X      {
  231. X!     plot1(cp,"   You  crashed  into  a planet.  Oh  dear,  Oh  dear,   ");
  232. X!     plot2(cp,"   The crater you left was 12 miles wide. Your'e Dead!   ");
  233. X!     if (cp->reason>0) cp->reason= -1;
  234. X!     finish(cp);
  235. X      break;
  236. X      }
  237. X  case '.' :
  238. X      {
  239. X-     cp->maxenergy -= 30;
  240. X-     cp->energy -= 30;
  241. X-     plotenergy(cp);
  242. X-     plotmaxenergy(cp);
  243. X      plot1(cp,"    You collided with a star. Warp capability has been   ");
  244. X      plot2(cp,"    reduced by 30, and your  energy  is  30 lower now.   ");
  245. X!     if (cp->stat!=5) plotstatus(cp,4);
  246. X      break;
  247. X      }
  248. X  case 'k' :
  249. X--- 52,86 ----
  250. X      }
  251. X  case 'O' :
  252. X      {
  253. X!     plot1(cp,"You struck the planet. The crater you left was 24 miles  ");
  254. X!     plot2(cp,"wide. You lost 499 energy units. WARNING : ENERGY LOW!!  ");
  255. X!     cp->energy -= 499;
  256. X!     cp->maxenergy -= 499;
  257. X!     plotbattleenergy(cp);
  258. X!     bounceplayer(cp);
  259. X!     if (cp->energy<0 && cp->reason>0) 
  260. X!             {
  261. X!             cp->reason= -1;
  262. X!             finish(cp);
  263. X!             }
  264. X      break;
  265. X      }
  266. X  case '.' :
  267. X      {
  268. X      plot1(cp,"    You collided with a star. Warp capability has been   ");
  269. X      plot2(cp,"    reduced by 30, and your  energy  is  30 lower now.   ");
  270. X!     cp->maxenergy -= 30;
  271. X!     cp->energy -= 30;
  272. X!     plotbattleenergy(cp);
  273. X!     bounceplayer(cp);
  274. X!     if (cp->energy<0 && cp->reason>0) 
  275. X!             {
  276. X!             cp->reason= -6;
  277. X!             finish(cp);
  278. X!             } else
  279. X!             {
  280. X!             if (cp->stat!=5) plotstatus(cp,4);
  281. X!             }
  282. X      break;
  283. X      }
  284. X  case 'k' :
  285. X***************
  286. X*** 56,66 ****
  287. X      {
  288. X      cp->maxenergy -= 100;
  289. X      cp->energy -= 100;
  290. X-     plotenergy(cp);
  291. X-     plotmaxenergy(cp);
  292. X      plot1(cp,"    You collided with a klingon mevisic mine...          ");
  293. X      plot2(cp,"    Energy and Maxenergy have dropped by 100.            ");
  294. X!     if (cp->stat!=5) plotstatus(cp,4);
  295. X      break;
  296. X      }
  297. X  case '#' :
  298. X--- 87,104 ----
  299. X      {
  300. X      cp->maxenergy -= 100;
  301. X      cp->energy -= 100;
  302. X      plot1(cp,"    You collided with a klingon mevisic mine...          ");
  303. X      plot2(cp,"    Energy and Maxenergy have dropped by 100.            ");
  304. X!     plotbattleenergy(cp);
  305. X!     bounceplayer(cp);
  306. X!     if (cp->energy<0 && cp->reason>0) 
  307. X!             {
  308. X!             cp->reason= -8;
  309. X!             finish(cp);
  310. X!             } else
  311. X!             {
  312. X!             if (cp->stat!=5) plotstatus(cp,4);
  313. X!             }
  314. X      break;
  315. X      }
  316. X  case '#' :
  317. X***************
  318. X*** 67,77 ****
  319. X      {
  320. X      cp->maxenergy -= 400;
  321. X      cp->energy -= 400;
  322. X-     plotenergy(cp);
  323. X-     plotmaxenergy(cp);
  324. X      plot1(cp,"    You collided with a Romulan Warning buoy.            ");
  325. X      plot2(cp,"    Energy and Maxenergy have dropped by 400.            ");
  326. X!     if (cp->stat!=5) plotstatus(cp,4);
  327. X      break;
  328. X      }
  329. X  case 'o' :
  330. X--- 105,122 ----
  331. X      {
  332. X      cp->maxenergy -= 400;
  333. X      cp->energy -= 400;
  334. X      plot1(cp,"    You collided with a Romulan Warning buoy.            ");
  335. X      plot2(cp,"    Energy and Maxenergy have dropped by 400.            ");
  336. X!     plotbattleenergy(cp);
  337. X!     bounceplayer(cp);
  338. X!     if (cp->energy<0 && cp->reason>0) 
  339. X!             {
  340. X!             cp->reason= -7;
  341. X!             finish(cp);
  342. X!             } else
  343. X!             {
  344. X!             if (cp->stat!=5) plotstatus(cp,4);
  345. X!             }
  346. X      break;
  347. X      }
  348. X  case 'o' :
  349. X*** ../../mpss/consoleplots.c    Thu Jun 23 10:22:05 1988
  350. X--- consoleplots.c    Wed Jul 27 14:36:06 1988
  351. X***************
  352. X*** 1,4 ****
  353. X--- 1,5 ----
  354. X  
  355. X+ /********VERSION 1.4!!! (Files from different Versions are INCOMPATIBLE!*******/
  356. X  /*******************************************************************************
  357. X  ********************************************************************************
  358. X  ********************************************************************************
  359. X***************
  360. X*** 108,113 ****
  361. X--- 109,115 ----
  362. X  char energy[5];    
  363. X  
  364. X  if ((cp->id==ROMID)||(cp->id==KLINGID)) return(0);
  365. X+ cp->screenenergy=cp->energy;
  366. X  if (cp->energy>0)
  367. X  {
  368. X  sprintf(energy," %4d",cp->energy);
  369. X***************
  370. X*** 131,136 ****
  371. X--- 133,139 ----
  372. X  char energy[5];    
  373. X  
  374. X  if ((d->id==ROMID)||(d->id==KLINGID)) return(0);
  375. X+ d->screenenergy=d->energy;
  376. X  sprintf(energy," %4d",d->energy);
  377. X  poscurs(d,14,7); 
  378. X  write(d->fd,energy,5);
  379. X*** ../../mpss/cross.c    Thu Jun 23 10:22:05 1988
  380. X--- cross.c    Wed Jul 27 14:36:07 1988
  381. X***************
  382. X*** 1,4 ****
  383. X--- 1,5 ----
  384. X  
  385. X+ /********VERSION 1.4!!! (Files from different Versions are INCOMPATIBLE!*******/
  386. X  /*******************************************************************************
  387. X  ********************************************************************************
  388. X  ********************************************************************************
  389. X***************
  390. X*** 164,170 ****
  391. X  poscurs(cp,20,7);
  392. X  write(cp->fd, "d,f => dock/undock, 1..9 => fire weapon, p => weapon sel.",57); 
  393. X  poscurs(cp,20,8);
  394. X! write(cp->fd, "    q => show quadrant, w => show warp, e => show energy ",57); 
  395. X  poscurs(cp,20,9);
  396. X  write(cp->fd, "      c => cloaking device on/off, v => shields on/off   ",57); 
  397. X  poscurs(cp,20,10);
  398. X--- 165,171 ----
  399. X  poscurs(cp,20,7);
  400. X  write(cp->fd, "d,f => dock/undock, 1..9 => fire weapon, p => weapon sel.",57); 
  401. X  poscurs(cp,20,8);
  402. X! write(cp->fd, "    q => show exact quadrant,   e => show exact energy   ",57); 
  403. X  poscurs(cp,20,9);
  404. X  write(cp->fd, "      c => cloaking device on/off, v => shields on/off   ",57); 
  405. X  poscurs(cp,20,10);
  406. X*** ../../mpss/cursor.c    Thu Jun 23 10:22:06 1988
  407. X--- cursor.c    Wed Jul 27 14:36:07 1988
  408. X***************
  409. X*** 1,4 ****
  410. X--- 1,5 ----
  411. X  
  412. X+ /********VERSION 1.4!!! (Files from different Versions are INCOMPATIBLE!*******/
  413. X  /*******************************************************************************
  414. X  ********************************************************************************
  415. X  ********************************************************************************
  416. X***************
  417. X*** 44,50 ****
  418. X          return(0);
  419. X          break;
  420. X      case 1 :
  421. X! fprintf(stderr,"                 Found entry for automatic terminal option\n");
  422. X          break;
  423. X      default:
  424. X          fprintf(stderr,"get_termcap_entry:Somethings wrong!!\n");
  425. X--- 45,51 ----
  426. X          return(0);
  427. X          break;
  428. X      case 1 :
  429. X! fprintf(stderr,"                Found entry for automatic terminal option\n");
  430. X          break;
  431. X      default:
  432. X          fprintf(stderr,"get_termcap_entry:Somethings wrong!!\n");
  433. X*** ../../mpss/dock.c    Thu Jun 23 10:22:06 1988
  434. X--- dock.c    Wed Jul 27 14:36:07 1988
  435. X***************
  436. X*** 1,4 ****
  437. X--- 1,5 ----
  438. X  
  439. X+ /********VERSION 1.4!!! (Files from different Versions are INCOMPATIBLE!*******/
  440. X  /*******************************************************************************
  441. X  ********************************************************************************
  442. X  ********************************************************************************
  443. X***************
  444. X*** 27,33 ****
  445. X          dockingok=ON;
  446. X  if (dockingok==OFF)
  447. X      {
  448. X!     plot1(cp,"   Your'e not beside a federation starbase Captain.      ");
  449. X      plot2(cp,"                                                         ");
  450. X      } else
  451. X      {
  452. X--- 28,34 ----
  453. X          dockingok=ON;
  454. X  if (dockingok==OFF)
  455. X      {
  456. X!     plot1(cp," Your'e not beside any starbase or spacedock Captain.    ");
  457. X      plot2(cp,"                                                         ");
  458. X      } else
  459. X      {
  460. X*** ../../mpss/keyscan.c    Thu Jun 23 10:22:06 1988
  461. X--- keyscan.c    Wed Jul 27 14:36:07 1988
  462. X***************
  463. X*** 1,4 ****
  464. X--- 1,5 ----
  465. X  
  466. X+ /********VERSION 1.4!!! (Files from different Versions are INCOMPATIBLE!*******/
  467. X  /*******************************************************************************
  468. X  ********************************************************************************
  469. X  ********************************************************************************
  470. X*** ../../mpss/main.c    Thu Jun 23 10:22:06 1988
  471. X--- main.c    Wed Jul 27 14:36:07 1988
  472. X***************
  473. X*** 1,4 ****
  474. X--- 1,5 ----
  475. X  
  476. X+ /********VERSION 1.4!!! (Files from different Versions are INCOMPATIBLE!*******/
  477. X  /*******************************************************************************
  478. X  ********************************************************************************
  479. X  ********************************************************************************
  480. X***************
  481. X*** 16,21 ****
  482. X--- 17,40 ----
  483. X  #include "files.h"
  484. X  #include "header.h"
  485. X  
  486. X+ lognewprocess(procno)
  487. X+ int procno;
  488. X+ {
  489. X+ FILE *f, *fopen();
  490. X+ char arr[15];
  491. X+ 
  492. X+     if ((f=fopen(PROCESSFILE,"a"))==NULL)
  493. X+         {
  494. X+         fprintf(stdout,"slave.c : error trying to log processnumber\n");
  495. X+         die();
  496. X+         } else
  497. X+         {
  498. X+         sprintf(arr,"%d\n",procno);
  499. X+         fputs(arr,f);
  500. X+         fclose(f);
  501. X+         }
  502. X+ }
  503. X+ 
  504. X  checkmasterpidfile()
  505. X  {
  506. X  int rpid,masterpid;
  507. X***************
  508. X*** 40,46 ****
  509. X      die();
  510. X      }
  511. X  signal(SIGALRM,checkmasterpidfile);
  512. X! alarm(180);
  513. X  }
  514. X  
  515. X  
  516. X--- 59,65 ----
  517. X      die();
  518. X      }
  519. X  signal(SIGALRM,checkmasterpidfile);
  520. X! alarm(60);
  521. X  }
  522. X  
  523. X  
  524. X***************
  525. X*** 80,91 ****
  526. X  main()
  527. X  {
  528. X  register struct player *cp;
  529. X! int f,o;
  530. X  register int x,y,x1,x2,y1,y2,xx1,xx2,yy1,yy2,xold,yold,xnew,ynew;
  531. X  register char c;
  532. X  register struct torpedo *torpedo;
  533. X! register int xx,test;
  534. X      
  535. X  test=1;
  536. X  f=umask(000);
  537. X  killcontrol();
  538. X--- 99,111 ----
  539. X  main()
  540. X  {
  541. X  register struct player *cp;
  542. X! int sener,ener,f,o;
  543. X  register int x,y,x1,x2,y1,y2,xx1,xx2,yy1,yy2,xold,yold,xnew,ynew;
  544. X  register char c;
  545. X  register struct torpedo *torpedo;
  546. X! register int loop,xx,test;
  547. X      
  548. X+ lognewprocess(getpid());
  549. X  test=1;
  550. X  f=umask(000);
  551. X  killcontrol();
  552. X***************
  553. X*** 124,129 ****
  554. X--- 144,167 ----
  555. X               goto goonlabel;
  556. X               }
  557. X      cp->clflg=OFF;
  558. X+ 
  559. X+ 
  560. X+ 
  561. X+ /**********************TUNING DELAY LOOP FOR SINGLE-PLAYER-MODE****************/
  562. X+ /*
  563. X+ Alter the number  (10) below. Increase it to slow down the game, decrease it
  564. X+ to speed it up, or delete the loop as a whole if your machine runs mpss to
  565. X+ slowly in single player mode.
  566. X+    
  567. X+                         This number > v 
  568. X+                                     v
  569. X+                             v                
  570. X+ if (noofplayers==1) for (loop=1; loop < 10; loop++);
  571. X+ */
  572. X+ /**********************TUNING DELAY LOOP FOR SINGLE-PLAYER-MODE****************/
  573. X+     
  574. X+ 
  575. X+ 
  576. X      ioctl(cp->fd,FIONREAD,&noofchars);
  577. X      if (noofchars>0) processinput(cp,&noofchars);
  578. X      if ((cp->stat==5)&&(cp->flyto>=0)&&(cp->flyto<4)) auto_pilot(cp);
  579. X***************
  580. X*** 273,282 ****
  581. X  
  582. X  if ((x<58)||(x>899)||(y<19)||(y>899))
  583. X      {
  584. X!     if (x<58) cp->xvel=1;
  585. X!     if (x>899) cp->xvel= -1;
  586. X!     if (y<19) cp->yvel=1;
  587. X!     if (y>899) cp->yvel= -1;
  588. X      } else 
  589. X      {
  590. X      if ((c=inuniv(x,y))!=NULL) collision(cp,c);
  591. X--- 311,336 ----
  592. X  
  593. X  if ((x<58)||(x>899)||(y<19)||(y>899))
  594. X      {
  595. X!     if (x<58) 
  596. X!         {
  597. X!         cp->xvel=1;
  598. X!         plotvelocity(cp);
  599. X!         }
  600. X!     if (x>899) 
  601. X!         {
  602. X!         cp->xvel= -1;
  603. X!         plotvelocity(cp);
  604. X!         }
  605. X!     if (y<19) 
  606. X!         {
  607. X!         cp->yvel=1;
  608. X!         plotvelocity(cp);
  609. X!         }
  610. X!     if (y>899) 
  611. X!         {
  612. X!         cp->yvel= -1;
  613. X!         plotvelocity(cp);
  614. X!         }
  615. X      } else 
  616. X      {
  617. X      if ((c=inuniv(x,y))!=NULL) collision(cp,c);
  618. X***************
  619. X*** 342,349 ****
  620. X  
  621. X      skipenergy:
  622. X      
  623. X!     if ((cp->energy==75)&&(storm==OFF)) flare();
  624. X!     if (cp->energy<100) plotenergy(cp);
  625. X      /*ENERGY CALCULATION*/
  626. X  goonlabel:
  627. X      if (cp->impulsemove>0) {
  628. X--- 396,410 ----
  629. X  
  630. X      skipenergy:
  631. X      
  632. X!     ener=cp->energy;
  633. X!     sener=cp->screenenergy;
  634. X!     
  635. X!     if ((ener==75)&&(storm==OFF)) flare();
  636. X!     if (ener!=sener)
  637. X!         {
  638. X!     if ((ener<=100) || (((ener%50)==0)) || (ener==cp->maxenergy))
  639. X!         plotenergy(cp);
  640. X!         }
  641. X      /*ENERGY CALCULATION*/
  642. X  goonlabel:
  643. X      if (cp->impulsemove>0) {
  644. X*** ../../mpss/mpss.c    Thu Jun 23 10:22:06 1988
  645. X--- mpss.c    Wed Jul 27 14:36:08 1988
  646. X***************
  647. X*** 1,4 ****
  648. X--- 1,18 ----
  649. X  
  650. X+ /********VERSION 1.4!!! (Files from different Versions are INCOMPATIBLE!*******/
  651. X+ /*******************************************************************************
  652. X+ ********************************************************************************
  653. X+ ********************************************************************************
  654. X+ 
  655. X+ PERMISSION TO COPY THIS SOFTWARE IS HEREBY GIVEN BY THE AUTHOR PROVIDED THAT
  656. X+ THIS LEADING MESSAGE IS INCLUDED IN ALL OF THE RELEVANT SOURCE FILES.
  657. X+ 
  658. X+         P. SCHMITZ, UNIVERSITY OF KEELE, MAY 1988.
  659. X+ 
  660. X+ 
  661. X+ ********************************************************************************
  662. X+ ********************************************************************************
  663. X+ *******************************************************************************/
  664. X  #include <stdio.h>
  665. X  #include "files.h"
  666. X  
  667. X*** ../../mpss/mpssclean.c    Thu Jun 23 10:22:06 1988
  668. X--- mpssclean.c    Wed Jul 27 14:36:08 1988
  669. X***************
  670. X*** 1,3 ****
  671. X--- 1,18 ----
  672. X+ 
  673. X+ /********VERSION 1.4!!! (Files from different Versions are INCOMPATIBLE!*******/
  674. X+ /*******************************************************************************
  675. X+ ********************************************************************************
  676. X+ ********************************************************************************
  677. X+ 
  678. X+ PERMISSION TO COPY THIS SOFTWARE IS HEREBY GIVEN BY THE AUTHOR PROVIDED THAT
  679. X+ THIS LEADING MESSAGE IS INCLUDED IN ALL OF THE RELEVANT SOURCE FILES.
  680. X+ 
  681. X+         P. SCHMITZ, UNIVERSITY OF KEELE, MAY 1988.
  682. X+ 
  683. X+ 
  684. X+ ********************************************************************************
  685. X+ ********************************************************************************
  686. X+ *******************************************************************************/
  687. X  #include <stdio.h>
  688. X  #include "files.h"
  689. X  #include <signal.h>
  690. X***************
  691. X*** 5,14 ****
  692. X  
  693. X  main()
  694. X  {
  695. X! int rpid;
  696. X  char string[15];
  697. X  char remove[80];
  698. X  FILE *f, *fopen();
  699. X  
  700. X  sprintf(remove,"rm %s\n",PLAYERFILE);
  701. X  system(remove);
  702. X--- 20,36 ----
  703. X  
  704. X  main()
  705. X  {
  706. X! int rpid,procno;
  707. X  char string[15];
  708. X  char remove[80];
  709. X+ char arr[15];
  710. X  FILE *f, *fopen();
  711. X+         
  712. X+ fprintf(stdout,"            MPSS CLEANUP PROGRAM..\n");
  713. X+ fprintf(stdout," This program quits any game currently running,\n");
  714. X+ fprintf(stdout," and/or it cleans up files and processes  left \n");
  715. X+ fprintf(stdout,"on your system incase MPSS was stopped abnormally.\n");
  716. X+ fprintf(stdout,"     Please ignore any error messages below. \n\n");
  717. X  
  718. X  sprintf(remove,"rm %s\n",PLAYERFILE);
  719. X  system(remove);
  720. X***************
  721. X*** 26,30 ****
  722. X--- 48,69 ----
  723. X      fclose(f);
  724. X      }
  725. X  sprintf(remove,"rm %s\n",MASTERPIDFILE);
  726. X+ system(remove);
  727. X+ 
  728. X+     if ((f=fopen(PROCESSFILE,"r"))==NULL)
  729. X+         {
  730. X+         fprintf(stdout,"mpssclean : processnumber file not existent.\n");
  731. X+         exit(0);
  732. X+         } else
  733. X+         {
  734. X+         while ((fgets(arr,15,f))!=NULL)
  735. X+             {
  736. X+             sscanf(arr,"%d\n",&procno);
  737. X+             kill(procno,9);
  738. X+             fprintf(stdout,"mpssclean : killed process number : %d\n",procno);
  739. X+             }
  740. X+         fclose(f);
  741. X+         }
  742. X+ sprintf(remove,"rm %s\n",PROCESSFILE);
  743. X  system(remove);
  744. X  }
  745. X*** ../../mpss/newplayer.c    Thu Jun 23 10:22:06 1988
  746. X--- newplayer.c    Wed Jul 27 14:36:08 1988
  747. X***************
  748. X*** 1,4 ****
  749. X--- 1,5 ----
  750. X  
  751. X+ /********VERSION 1.4!!! (Files from different Versions are INCOMPATIBLE!*******/
  752. X  /*******************************************************************************
  753. X  ********************************************************************************
  754. X  ********************************************************************************
  755. X*** ../../mpss/orbit.c    Thu Jun 23 10:22:07 1988
  756. X--- orbit.c    Wed Jul 27 14:36:08 1988
  757. X***************
  758. X*** 1,4 ****
  759. X--- 1,5 ----
  760. X  
  761. X+ /********VERSION 1.4!!! (Files from different Versions are INCOMPATIBLE!*******/
  762. X  /*******************************************************************************
  763. X  ********************************************************************************
  764. X  ********************************************************************************
  765. X***************
  766. X*** 113,120 ****
  767. X      plot2(cp,"Most of our energy has been used to keep us in the air.  ");
  768. X      cp->energy -= 300;
  769. X      cp->maxenergy -= 300;
  770. X!     plotenergy(cp);
  771. X!     plotmaxenergy(cp);
  772. X      return(0);
  773. X      } 
  774. X  
  775. X--- 114,125 ----
  776. X      plot2(cp,"Most of our energy has been used to keep us in the air.  ");
  777. X      cp->energy -= 300;
  778. X      cp->maxenergy -= 300;
  779. X!     plotbattleenergy(cp);
  780. X!     if (cp->energy<0 && cp->reason>0) 
  781. X!             {
  782. X!             cp->reason= -12;
  783. X!             finish(cp);
  784. X!             }
  785. X      return(0);
  786. X      } 
  787. X  
  788. X*** ../../mpss/planets.c    Thu Jun 23 10:22:07 1988
  789. X--- planets.c    Wed Jul 27 14:36:09 1988
  790. X***************
  791. X*** 1,4 ****
  792. X--- 1,5 ----
  793. X  
  794. X+ /********VERSION 1.4!!! (Files from different Versions are INCOMPATIBLE!*******/
  795. X  /*******************************************************************************
  796. X  ********************************************************************************
  797. X  ********************************************************************************
  798. X***************
  799. X*** 19,31 ****
  800. X      {
  801. X      0,220,670,
  802. X      "          Spock : We are now orbiting earth sir.         ",
  803. X!     "                ***************                          ",
  804. X!     "         ********             *********                  ",
  805. X!     "         *     Starfleet Command      *                  ",
  806. X!     "         *United Federation of Planets*                  ",
  807. X!     "         *   Starfleet Headquarters   *                  ",
  808. X!     "         ********             *********                  ",
  809. X!     "                ***************                          ",
  810. X      "Admiral Nogouchi : Welcome to Starfleet Command Kirk.    ",
  811. X      "Your mission will last for 5 years flying around the     ",
  812. X      "Galaxy to explore new life whereever you can. While you  ",
  813. X--- 20,32 ----
  814. X      {
  815. X      0,220,670,
  816. X      "          Spock : We are now orbiting earth sir.         ",
  817. X!     "                 **********************                  ",
  818. X!     "             *****                    *****              ",
  819. X!     "           ***     Starfleet Command      ***            ",
  820. X!     "         *****United Federation of Planets*****          ",
  821. X!     "           ***   Starfleet Headquarters   ***            ",
  822. X!     "             *****                    *****              ",
  823. X!     "                 **********************                  ",
  824. X      "Admiral Nogouchi : Welcome to Starfleet Command Kirk.    ",
  825. X      "Your mission will last for 5 years flying around the     ",
  826. X      "Galaxy to explore new life whereever you can. While you  ",
  827. X***************
  828. X*** 80,86 ****
  829. X      "Effect : You are now a Jedi.     /                       ",
  830. X      " This is your new weapon-->     /                        ",
  831. X      "                              /_/                        ",
  832. X!     3,400,675,
  833. X      "Spock : This is Ceti Alpha 6. Where we left Khan marooned",
  834. X      "You are standing on the planet but Khan and his crew are ",
  835. X      "nowhere to be found. However you do find a  dilithium    ",
  836. X--- 81,87 ----
  837. X      "Effect : You are now a Jedi.     /                       ",
  838. X      " This is your new weapon-->     /                        ",
  839. X      "                              /_/                        ",
  840. X!     3,400,676,
  841. X      "Spock : This is Ceti Alpha 6. Where we left Khan marooned",
  842. X      "You are standing on the planet but Khan and his crew are ",
  843. X      "nowhere to be found. However you do find a  dilithium    ",
  844. X***************
  845. X*** 374,380 ****
  846. X      "%%%%%%%%%%%%%%           .  ||             :             ",
  847. X      "%%%%%%%%%%%%%               --                           ",
  848. X      "%%%%%%%%%%%%                                             ",
  849. X!     17,300,225,
  850. X      "Spock : We are now orbiting the remote ice-world of Hoth.",
  851. X      "You arrive and ar in for a bad shock. Its freeeezing here",
  852. X      "and you decide to find shelter in a local cave. There you",
  853. X--- 375,381 ----
  854. X      "%%%%%%%%%%%%%%           .  ||             :             ",
  855. X      "%%%%%%%%%%%%%               --                           ",
  856. X      "%%%%%%%%%%%%                                             ",
  857. X!     17,300,226,
  858. X      "Spock : We are now orbiting the remote ice-world of Hoth.",
  859. X      "You arrive and ar in for a bad shock. Its freeeezing here",
  860. X      "and you decide to find shelter in a local cave. There you",
  861. X***************
  862. X*** 584,590 ****
  863. X      "                                                         ",
  864. X      "                                                         ",
  865. X      "                                                         ",
  866. X!     27,675,410,
  867. X      "Spock : We are now orbiting the klingon planet Kharse II.",
  868. X      " You find a vast computer complex and enter. You are     ",
  869. X      "surrounded by machines, lights and basically feel pretty ",
  870. X--- 585,591 ----
  871. X      "                                                         ",
  872. X      "                                                         ",
  873. X      "                                                         ",
  874. X!     27,676,410,
  875. X      "Spock : We are now orbiting the klingon planet Kharse II.",
  876. X      " You find a vast computer complex and enter. You are     ",
  877. X      "surrounded by machines, lights and basically feel pretty ",
  878. X*** ../../mpss/processinput.c    Fri Jul 15 09:51:28 1988
  879. X--- processinput.c    Wed Jul 27 14:36:09 1988
  880. X***************
  881. X*** 1,4 ****
  882. X--- 1,5 ----
  883. X  
  884. X+ /********VERSION 1.4!!! (Files from different Versions are INCOMPATIBLE!*******/
  885. X  /*******************************************************************************
  886. X  ********************************************************************************
  887. X  ********************************************************************************
  888. X***************
  889. X*** 22,28 ****
  890. X  {
  891. X  register struct player *x,*o;
  892. X  int z;
  893. X! unsigned char c;    /* override "char c" in header.h  -- br */
  894. X  
  895. X  getbuf(cp,ptrnoofchars);
  896. X  while ((c=getchr(cp))!='\0')
  897. X--- 23,29 ----
  898. X  {
  899. X  register struct player *x,*o;
  900. X  int z;
  901. X! unsigned char c;    
  902. X  
  903. X  getbuf(cp,ptrnoofchars);
  904. X  while ((c=getchr(cp))!='\0')
  905. X***************
  906. X*** 530,537 ****
  907. X          cp->message[i]=' ';
  908. X          cp->messindex=0;
  909. X          break;
  910. X-     case 'w': plotvelocity(cp);
  911. X-           break;
  912. X      case 'e': plotenergy(cp);
  913. X            break;
  914. X      case 'd': if (cp->stat!=7) dock(cp);
  915. X--- 531,536 ----
  916. X***************
  917. X*** 592,598 ****
  918. X  impulse_message(cp)
  919. X  register struct player *cp;
  920. X  {
  921. X-         plotvelocity(cp);
  922. X          plot1(cp,"   Manoevering Impulse Thrusters only function from      ");
  923. X          plot2(cp,"   a stationary position..thrusters are overheated.      ");
  924. X  }
  925. X--- 591,596 ----
  926. X***************
  927. X*** 614,622 ****
  928. X          if (abs(cp->xvel)>cp->maxvel)
  929. X              {
  930. X              if (cp->xvel<0) ++(cp->xvel); else --(cp->xvel);
  931. X!             } else
  932. X              {
  933. X              if (cp->yvel<0) ++(cp->yvel); else --(cp->yvel);
  934. X              }
  935. X!     }
  936. X  }
  937. X--- 612,621 ----
  938. X          if (abs(cp->xvel)>cp->maxvel)
  939. X              {
  940. X              if (cp->xvel<0) ++(cp->xvel); else --(cp->xvel);
  941. X!             } 
  942. X!         if (abs(cp->yvel)>cp->maxvel)
  943. X              {
  944. X              if (cp->yvel<0) ++(cp->yvel); else --(cp->yvel);
  945. X              }
  946. X!     } else plotvelocity(cp);
  947. X  }
  948. X*** ../../mpss/scan.c    Thu Jun 23 10:22:08 1988
  949. X--- scan.c    Wed Jul 27 14:36:09 1988
  950. X***************
  951. X*** 1,4 ****
  952. X--- 1,5 ----
  953. X  
  954. X+ /********VERSION 1.4!!! (Files from different Versions are INCOMPATIBLE!*******/
  955. X  /*******************************************************************************
  956. X  ********************************************************************************
  957. X  ********************************************************************************
  958. X*** ../../mpss/setupuniverse.c    Thu Jun 23 10:22:08 1988
  959. X--- setupuniverse.c    Wed Jul 27 14:36:09 1988
  960. X***************
  961. X*** 1,4 ****
  962. X--- 1,5 ----
  963. X  
  964. X+ /********VERSION 1.4!!! (Files from different Versions are INCOMPATIBLE!*******/
  965. X  /*******************************************************************************
  966. X  ********************************************************************************
  967. X  ********************************************************************************
  968. X*** ../../mpss/ships.c    Thu Jun 23 10:22:08 1988
  969. X--- ships.c    Wed Jul 27 14:36:09 1988
  970. X***************
  971. X*** 1,4 ****
  972. X--- 1,5 ----
  973. X  
  974. X+ /********VERSION 1.4!!! (Files from different Versions are INCOMPATIBLE!*******/
  975. X  /*******************************************************************************
  976. X  ********************************************************************************
  977. X  ********************************************************************************
  978. X*** ../../mpss/slave.c    Thu Jun 23 10:22:08 1988
  979. X--- slave.c    Wed Jul 27 14:36:10 1988
  980. X***************
  981. X*** 1,4 ****
  982. X--- 1,5 ----
  983. X  
  984. X+ /********VERSION 1.4!!! (Files from different Versions are INCOMPATIBLE!*******/
  985. X  /*******************************************************************************
  986. X  ********************************************************************************
  987. X  ********************************************************************************
  988. X***************
  989. X*** 45,50 ****
  990. X--- 46,94 ----
  991. X          char name[10];
  992. X          int score;
  993. X            } sb[50];
  994. X+ 
  995. X+ lognewprocess(procno)
  996. X+ int procno;
  997. X+ {
  998. X+ char arr[15];
  999. X+ 
  1000. X+     if ((f=fopen(PROCESSFILE,"a"))==NULL)
  1001. X+         {
  1002. X+         fprintf(stdout,"slave.c : error trying to log processnumber\n");
  1003. X+         abnormdie();
  1004. X+         } else
  1005. X+         {
  1006. X+         sprintf(arr,"%d\n",procno);
  1007. X+         fputs(arr,f);
  1008. X+         fclose(f);
  1009. X+         }
  1010. X+ }
  1011. X+ 
  1012. X+ checkmasterpidfile()
  1013. X+ {
  1014. X+ int rpid;
  1015. X+ char string[15];
  1016. X+ FILE *ff,*fopen();
  1017. X+ 
  1018. X+ if ((ff=fopen(MASTERPIDFILE,"r"))==NULL) 
  1019. X+     {
  1020. X+     fprintf(stdout,"slave.c: Can't read masterpidfile\n");
  1021. X+     abnormdie();
  1022. X+     } else
  1023. X+     {
  1024. X+     fgets(string,15,ff); /*get pid*/
  1025. X+     fclose(ff);
  1026. X+     }
  1027. X+ sscanf(string,"%d\n",&rpid);
  1028. X+ if (rpid!=masterpid) 
  1029. X+     {
  1030. X+     fprintf(stdout,"slave.c: pids not equal!!! %d %d\n",rpid,masterpid);
  1031. X+     abnormdie();
  1032. X+     }
  1033. X+ signal(SIGALRM,checkmasterpidfile);
  1034. X+ /*fprintf(stdout,"slave.c : checked masterpid. its OK!!\n");*/
  1035. X+ alarm(20);
  1036. X+ }
  1037. X   
  1038. X  readinscores()
  1039. X  {
  1040. X***************
  1041. X*** 63,70 ****
  1042. X      } else
  1043. X      {
  1044. X      sleep(3);
  1045. X!     clrscreenslave(cl,tty_type);
  1046. X!     fprintf(stdout,"Two games were created at once. Please try again. That should work.\n");
  1047. X      return(0);
  1048. X      }
  1049. X  
  1050. X--- 107,116 ----
  1051. X      } else
  1052. X      {
  1053. X      sleep(3);
  1054. X!     fprintf(stdout,"Either the program aborted abnormally or two games were created at the same time.\n");
  1055. X!     fprintf(stdout,"If two games were created at once. Please try again. That should work.\n");
  1056. X!     fprintf(stdout,"(This is likely if you & someone else startred a game at the same instant) \n");
  1057. X!     fprintf(stdout,"If nobody else is playing and you keep getting this message, do an mpssclean!\n");
  1058. X      return(0);
  1059. X      }
  1060. X  
  1061. X***************
  1062. X*** 91,97 ****
  1063. X  
  1064. X  if (i>=50)
  1065. X      {
  1066. X!     fprintf(stdout,"\nYou did so badly, that you didn't even make the scoreboard!\n");
  1067. X      unlink(PLAYERSCOREFILE);
  1068. X      return(0);
  1069. X      }
  1070. X--- 137,143 ----
  1071. X  
  1072. X  if (i>=50)
  1073. X      {
  1074. X!     fprintf(stdout,"\n      You did so badly, that you didn't even make the scoreboard!\n");
  1075. X      unlink(PLAYERSCOREFILE);
  1076. X      return(0);
  1077. X      }
  1078. X***************
  1079. X*** 142,148 ****
  1080. X  fprintf(stdout,"\n");
  1081. X  tputs(bon,1,slaveoutc);
  1082. X  fprintf(stdout,"*****************************************************************************\n");
  1083. X! fprintf(stdout,"*                MULTI-PLAYER-STAR-TREK's ALL TIME HIGHS                    *\n");
  1084. X  fprintf(stdout,"*****************************************************************************\n");
  1085. X  tputs(boff,1,slaveoutc);
  1086. X  fprintf(stdout,"*Position Name     Ships name          Cause of Death                 Score *\n");
  1087. X--- 188,194 ----
  1088. X  fprintf(stdout,"\n");
  1089. X  tputs(bon,1,slaveoutc);
  1090. X  fprintf(stdout,"*****************************************************************************\n");
  1091. X! fprintf(stdout,"*             MULTI-PLAYER-STAR-TREK's ALL TIME HIGHS (V 1.4)               *\n");
  1092. X  fprintf(stdout,"*****************************************************************************\n");
  1093. X  tputs(boff,1,slaveoutc);
  1094. X  fprintf(stdout,"*Position Name     Ships name          Cause of Death                 Score *\n");
  1095. X***************
  1096. X*** 178,184 ****
  1097. X          write(0,"Ran out of energy in flight!!",29);
  1098. X          break;
  1099. X      case -3:
  1100. X!         write(0,"activated Selfdestruct & quit",29);
  1101. X          break;
  1102. X      case -4:
  1103. X          write(0,"Blew up under heavy attack...",29);
  1104. X--- 224,230 ----
  1105. X          write(0,"Ran out of energy in flight!!",29);
  1106. X          break;
  1107. X      case -3:
  1108. X!         write(0,"Self-destructed the ship/quit",29);
  1109. X          break;
  1110. X      case -4:
  1111. X          write(0,"Blew up under heavy attack...",29);
  1112. X***************
  1113. X*** 186,191 ****
  1114. X--- 232,258 ----
  1115. X      case -5:
  1116. X          write(0,"Tried time warping twice.....",29);
  1117. X          break;
  1118. X+     case -6:
  1119. X+         write(0,"Flew into a star.............",29);
  1120. X+         break;
  1121. X+     case -7:
  1122. X+         write(0,"Struck a Romulan warning buoy",29);
  1123. X+         break;
  1124. X+     case -8:
  1125. X+         write(0,"Hit a Klingon mevisic mine...",29);
  1126. X+         break;
  1127. X+     case -9:
  1128. X+         write(0,"Shot by a Klingon destroyer..",29);
  1129. X+         break;
  1130. X+     case -10:
  1131. X+         write(0,"Shot by a Romulan cruiser....",29);
  1132. X+         break;
  1133. X+     case -11:
  1134. X+         write(0,"Was hit by flying ship debris",29);
  1135. X+         break;
  1136. X+     case -12:
  1137. X+         write(0,"Fried in a planets atmosphere",29);
  1138. X+         break;
  1139. X      default:
  1140. X          write(0,"Burnt up over Genesis........",29);
  1141. X          break;
  1142. X***************
  1143. X*** 208,214 ****
  1144. X      exit(0);
  1145. X  }
  1146. X  
  1147. X! 
  1148. X  /*
  1149. X   *    setrawmode()    Function to set cbreak -echo for the terminal
  1150. X   */
  1151. X--- 275,287 ----
  1152. X      exit(0);
  1153. X  }
  1154. X  
  1155. X! abnormdie()
  1156. X! {
  1157. X!     fprintf(stdout,"abnormal termination of program, try mpssclean.\n");
  1158. X!     unsetrawmode();
  1159. X!     exit(0);
  1160. X! }
  1161. X!     
  1162. X  /*
  1163. X   *    setrawmode()    Function to set cbreak -echo for the terminal
  1164. X   */
  1165. X***************
  1166. X*** 288,294 ****
  1167. X  fprintf(stderr,"Try again without the -t option. If you get the same result,\n");
  1168. X  fprintf(stderr,"you must modify the code. (See rules)\n");
  1169. X  }
  1170. X!                 exit(0);
  1171. X                  }
  1172. X          } else
  1173. X          {
  1174. X--- 361,367 ----
  1175. X  fprintf(stderr,"Try again without the -t option. If you get the same result,\n");
  1176. X  fprintf(stderr,"you must modify the code. (See rules)\n");
  1177. X  }
  1178. X!                 abnormdie();
  1179. X                  }
  1180. X          } else
  1181. X          {
  1182. X***************
  1183. X*** 305,310 ****
  1184. X--- 378,385 ----
  1185. X  int childpid,i;
  1186. X  char *s;
  1187. X  char c;
  1188. X+     
  1189. X+     lognewprocess(getpid());
  1190. X      nointro=0; termcap=0;
  1191. X      while(--argc>0 && (*++argv)[0]=='-')
  1192. X          for (s=argv[0]+1; *s!='\0'; s++)
  1193. X***************
  1194. X*** 335,370 ****
  1195. X                  }
  1196. X      setrawmode();
  1197. X  
  1198. X      srand(time()%10);
  1199. X      sleep(rand()%10);
  1200. X      
  1201. X!     while ((f=fopen(LOCK,"r"))!=NULL) 
  1202. X      { 
  1203. X      fclose(f); 
  1204. X!     fprintf(stdout,"                 Your'e in the queue to join. Please wait..\n");
  1205. X!     sleep(rand()%10);
  1206. X      }
  1207. X  
  1208. X      if ((i=creat(LOCK,0666))<0)
  1209. X          fprintf(stdout,"                  Cant create LOCK file.\n");
  1210. X      
  1211. X      statflg=OFF;
  1212. X      /*CHECK IF THE MASTER IS ALREADY RUNNING!!!*/
  1213. X      if ((f=fopen(MASTERPIDFILE,"r"))==NULL)
  1214. X      {
  1215. X      /*tell others the game is starting......*/
  1216. X      char run[80];
  1217. X      sprintf(run,"%s",MAILFILE);
  1218. X      system(run);
  1219. X      /*tell others the game is starting......*/
  1220. X-     clrscreenslave(cl,tty_type);
  1221. X      
  1222. X      fprintf(stdout,"                 Invoking the game for the first player....\n");
  1223. X      fprintf(stdout,"                 This takes about 30 seconds...............\n");
  1224. X      if ((pid=fork())==0) {
  1225. X          execl(MASTERPROGRAM,"peer",">&!/dev/null","&",(char *) 0);
  1226. X          fprintf(stderr,"cannot invoke master process!");
  1227. X!                 exit();
  1228. X                   } 
  1229. X      statflg=ON;
  1230. X      i=0;
  1231. X--- 410,472 ----
  1232. X                  }
  1233. X      setrawmode();
  1234. X  
  1235. X+     fprintf(stdout,"                Please wait..this can take a moment. \n");
  1236. X      srand(time()%10);
  1237. X      sleep(rand()%10);
  1238. X      
  1239. X!     i=1;
  1240. X!     while ((i<8)&&(f=fopen(LOCK,"r"))!=NULL) 
  1241. X      { 
  1242. X+     fprintf(stdout,"            %d) Please keep waiting (timeout at 10).\n",i);
  1243. X      fclose(f); 
  1244. X!     sleep(3+rand()%10);
  1245. X!     i++;
  1246. X      }
  1247. X+     
  1248. X+     if (i==8) 
  1249. X+         {
  1250. X+         unlink(LOCK);
  1251. X+         i=0;
  1252. X+         while ((i<6)&&(f=fopen(LOCK,"r"))!=NULL) 
  1253. X+             { 
  1254. X+             fclose(f); 
  1255. X+             fprintf(stdout,"  Your'e still in the queue to join. Please be patient a little more...\n");
  1256. X+             sleep(2+rand()%10);
  1257. X+             i++;
  1258. X+             }
  1259. X+         if (i==6)
  1260. X+             {
  1261. X+         fprintf(stdout,"Can't get LOCKfile to open. Try 'mpssclean' first.\n");
  1262. X+         abnormdie();
  1263. X+             }
  1264. X+         }
  1265. X+             
  1266. X  
  1267. X      if ((i=creat(LOCK,0666))<0)
  1268. X+         {
  1269. X          fprintf(stdout,"                  Cant create LOCK file.\n");
  1270. X+         abnormdie();
  1271. X+         }
  1272. X      
  1273. X      statflg=OFF;
  1274. X      /*CHECK IF THE MASTER IS ALREADY RUNNING!!!*/
  1275. X      if ((f=fopen(MASTERPIDFILE,"r"))==NULL)
  1276. X      {
  1277. X+     
  1278. X      /*tell others the game is starting......*/
  1279. X      char run[80];
  1280. X      sprintf(run,"%s",MAILFILE);
  1281. X      system(run);
  1282. X      /*tell others the game is starting......*/
  1283. X      
  1284. X+     
  1285. X+     clrscreenslave(cl,tty_type);
  1286. X      fprintf(stdout,"                 Invoking the game for the first player....\n");
  1287. X      fprintf(stdout,"                 This takes about 30 seconds...............\n");
  1288. X      if ((pid=fork())==0) {
  1289. X          execl(MASTERPROGRAM,"peer",">&!/dev/null","&",(char *) 0);
  1290. X          fprintf(stderr,"cannot invoke master process!");
  1291. X!         abnormdie();
  1292. X                   } 
  1293. X      statflg=ON;
  1294. X      i=0;
  1295. X***************
  1296. X*** 375,383 ****
  1297. X          i++;
  1298. X          }
  1299. X      if (i==20) {
  1300. X!         fprintf(stdout,"                          mpss : timed out waiting.\n");
  1301. X           unlink(LOCK);
  1302. X!          exit(0);
  1303. X          }
  1304. X      } 
  1305. X      fgets(masterpidname,15,f);
  1306. X--- 477,485 ----
  1307. X          i++;
  1308. X          }
  1309. X      if (i==20) {
  1310. X!         fprintf(stdout,"                          mpss : timed out waiting. Do mpssclean!\n");
  1311. X           unlink(LOCK);
  1312. X!          abnormdie();
  1313. X          }
  1314. X      } 
  1315. X      fgets(masterpidname,15,f);
  1316. X***************
  1317. X*** 425,430 ****
  1318. X--- 527,533 ----
  1319. X      sleep(4);
  1320. X      fprintf(stdout,"                                before.....\n");
  1321. X      sleep(3);
  1322. X+     clrscreenslave(cl,tty_type);
  1323. X      poscursslave(cm,tty_type,0,0);
  1324. X      fprintf(stdout,"\n");
  1325. X      fprintf(stdout,"\n");
  1326. X***************
  1327. X*** 448,474 ****
  1328. X      fprintf(stdout,"     *                                                               *\n");
  1329. X      fprintf(stdout,"     * Written by Peer Schmitz, University of Keele, Keele, Staffs,  *\n");
  1330. X      fprintf(stdout,"     * ST5-5BG, Jan. - Jul 88, due to a lack of STAR TREK on the box.*\n");
  1331. X!     fprintf(stdout,"     *                       Version 1.3....                         *\n");
  1332. X      fprintf(stdout,"     *****************************************************************\n");
  1333. X!     tputs(bon,1,slaveoutc);
  1334. X!     fprintf(stdout,"\n                                Hit any key\n");
  1335. X!     tputs(boff,1,slaveoutc);
  1336. X!     read(0,&c,1);
  1337. X  nextlabel:
  1338. X      if ((pid=fork())==0)
  1339. X          {
  1340. X          childpid=getpid();
  1341. X!         while ((f=fopen(PLAYERFILE,"r"))!=NULL)
  1342. X                          {
  1343. X                          fclose(f);
  1344. X!                         sleep(((int)(time()%10)));
  1345. X                          }
  1346. X          /*Now we know the file isnt there yet*/
  1347. X          i=creat(PLAYERFILE,0666);
  1348. X          if ((f=fopen(PLAYERFILE,"w"))==NULL)
  1349. X              {
  1350. X              fprintf(stdout,"CANNOT OPEN PLAYERFILE\n");
  1351. X!             exit(0);
  1352. X              } else
  1353. X              {
  1354. X              char c;
  1355. X--- 551,601 ----
  1356. X      fprintf(stdout,"     *                                                               *\n");
  1357. X      fprintf(stdout,"     * Written by Peer Schmitz, University of Keele, Keele, Staffs,  *\n");
  1358. X      fprintf(stdout,"     * ST5-5BG, Jan. - Jul 88, due to a lack of STAR TREK on the box.*\n");
  1359. X!     fprintf(stdout,"     *                         Version 1.4....                       *\n");
  1360. X      fprintf(stdout,"     *****************************************************************\n");
  1361. X!     sleep(17);
  1362. X!     clrscreenslave(cl,tty_type);
  1363. X  nextlabel:
  1364. X      if ((pid=fork())==0)
  1365. X          {
  1366. X+         signal(SIGALRM,checkmasterpidfile);
  1367. X          childpid=getpid();
  1368. X!         lognewprocess(childpid);
  1369. X!         i=1;
  1370. X!         while ((i<5)&&((f=fopen(PLAYERFILE,"r"))!=NULL))
  1371. X                          {
  1372. X                          fclose(f);
  1373. X!     fprintf(stdout,"                     %d) Please be patient a little more...\n",i);
  1374. X!                         sleep((2+(rand()%10)));
  1375. X!                         i++;
  1376. X                          }
  1377. X+     
  1378. X+         if (i==5) 
  1379. X+         {
  1380. X+         unlink(PLAYERFILE);
  1381. X+         i=1;
  1382. X+         while ((i<6)&&(f=fopen(PLAYERFILE,"r"))!=NULL) 
  1383. X+             { 
  1384. X+             fclose(f); 
  1385. X+     fprintf(stdout,"                     %d) Please be patient a little more...\n",i);
  1386. X+     fprintf(stdout,"                        Hang in there a little more...\n");
  1387. X+     fprintf(stdout,"                        (Ill time out soon if this fails.)\n");
  1388. X+             sleep(2+rand()%10);
  1389. X+             i++;
  1390. X+             }
  1391. X+         if (i==6)
  1392. X+             {
  1393. X+         fprintf(stdout,"Can't get Playerfile to open. Try 'mpssclean' first.\n");
  1394. X+         abnormdie();
  1395. X+             }
  1396. X+         }
  1397. X+             
  1398. X          /*Now we know the file isnt there yet*/
  1399. X          i=creat(PLAYERFILE,0666);
  1400. X          if ((f=fopen(PLAYERFILE,"w"))==NULL)
  1401. X              {
  1402. X              fprintf(stdout,"CANNOT OPEN PLAYERFILE\n");
  1403. X!              abnormdie();
  1404. X              } else
  1405. X              {
  1406. X              char c;
  1407. X***************
  1408. X*** 484,489 ****
  1409. X--- 611,617 ----
  1410. X      */
  1411. X              clrscreenslave(cl,tty_type);
  1412. X              kill(masterpid,29);
  1413. X+             alarm(20);
  1414. X              while(1);
  1415. X              }
  1416. X          }
  1417. X*** ../../mpss/torpedo.c    Thu Jun 23 10:22:08 1988
  1418. X--- torpedo.c    Wed Jul 27 14:36:10 1988
  1419. X***************
  1420. X*** 1,4 ****
  1421. X--- 1,5 ----
  1422. X  
  1423. X+ /********VERSION 1.4!!! (Files from different Versions are INCOMPATIBLE!*******/
  1424. X  /*******************************************************************************
  1425. X  ********************************************************************************
  1426. X  ********************************************************************************
  1427. X***************
  1428. X*** 16,22 ****
  1429. X  
  1430. X  move_torpedos()
  1431. X  {
  1432. X! int x,y;
  1433. X  int hit;
  1434. X  struct torpedo *t,*a;
  1435. X  struct player *p,*h;
  1436. X--- 17,23 ----
  1437. X  
  1438. X  move_torpedos()
  1439. X  {
  1440. X! int x,y,ll;
  1441. X  int hit;
  1442. X  struct torpedo *t,*a;
  1443. X  struct player *p,*h;
  1444. X***************
  1445. X*** 67,72 ****
  1446. X--- 68,83 ----
  1447. X              {
  1448. X              plot1(t->whofrom,"        Direct hit on enemy Captain! Well Done!          ");
  1449. X              plot2(t->whofrom,"                                                         ");
  1450. X+         if (h->id==ROMID) 
  1451. X+                 {
  1452. X+                 h->photonpower +=10; 
  1453. X+                 h->phaserpower +=5;
  1454. X+                 }
  1455. X+         if (h->id==KLINGID)
  1456. X+                 {
  1457. X+                 h->photonpower +=5; 
  1458. X+                 h->phaserpower +=2;
  1459. X+                 }
  1460. X              }
  1461. X          t->whofrom->score += 10;
  1462. X          plotscore(t->whofrom);
  1463. X***************
  1464. X*** 87,95 ****
  1465. X--- 98,128 ----
  1466. X                  if (t->whofrom->ypos == h->ypos)
  1467. X                      {
  1468. X                      if (t->whofrom->xpos <  h->xpos)
  1469. X+                         {
  1470. X+                         if (i<75)
  1471. X                          fire_torpedo(h,'4',0);
  1472. X+                         else
  1473. X+                         {
  1474. X+                         fire_torpedo(h,'4',0);
  1475. X+                         fire_torpedo(h,'1',0);
  1476. X+                         fire_torpedo(h,'7',0);
  1477. X+                         }
  1478. X+                         }
  1479. X                          else    
  1480. X+                         if (i<75)
  1481. X                          fire_torpedo(h,'6',0);
  1482. X+                         else
  1483. X+                         {
  1484. X+                         fire_torpedo(h,'6',0);
  1485. X+                         fire_torpedo(h,'9',0);
  1486. X+                         fire_torpedo(h,'3',0);
  1487. X+                         if (i>85)
  1488. X+                             {
  1489. X+                         fire_torpedo(h,'2',0);
  1490. X+                         fire_torpedo(h,'8',0);
  1491. X+                         fire_torpedo(h,'6',0);
  1492. X+                             }
  1493. X+                         }
  1494. X                      } else
  1495. X                      {
  1496. X                      if (t->whofrom->ypos < h->ypos)
  1497. X***************
  1498. X*** 150,156 ****
  1499. X              {
  1500. X              plot1(h,"        You have been blown out of the sky!!!            ");
  1501. X              plot2(h,"       Shame the force wasn't with you this time.        ");
  1502. X!             if (h->reason>0) h->reason= -4;
  1503. X              finish(h);
  1504. X              t->whofrom->score += 100;
  1505. X              plot1(t->whofrom,"        Chekov : Got him!! Bones : He's dead Jim!        ");
  1506. X--- 183,193 ----
  1507. X              {
  1508. X              plot1(h,"        You have been blown out of the sky!!!            ");
  1509. X              plot2(h,"       Shame the force wasn't with you this time.        ");
  1510. X!     if (t->whofrom->id!=ROMID 
  1511. X!      && t->whofrom->id!=KLINGID 
  1512. X!          && h->reason>0) h->reason= -4;
  1513. X!     if (t->whofrom->id==ROMID && h->reason>0) h->reason= -10;
  1514. X!     if (t->whofrom->id==KLINGID && h->reason>0) h->reason= -9;
  1515. X              finish(h);
  1516. X              t->whofrom->score += 100;
  1517. X              plot1(t->whofrom,"        Chekov : Got him!! Bones : He's dead Jim!        ");
  1518. X***************
  1519. X*** 172,180 ****
  1520. X          {
  1521. X          plot1(h,"   You were hit by a piece of debris from the explosion! ");
  1522. X          plot2(h,"         Your energy capability has been lowered.        ");
  1523. X!         h->energy-=10;
  1524. X!         h->maxenergy-=10;
  1525. X          plotbattleenergy(h);
  1526. X          }
  1527. X      } else /*hit is off!*/
  1528. X      {
  1529. X--- 209,222 ----
  1530. X          {
  1531. X          plot1(h,"   You were hit by a piece of debris from the explosion! ");
  1532. X          plot2(h,"         Your energy capability has been lowered.        ");
  1533. X!         h->energy-=30;
  1534. X!         h->maxenergy-=30;
  1535. X          plotbattleenergy(h);
  1536. X+         if (h->energy<0 && h->reason>0) 
  1537. X+             {
  1538. X+             h->reason= -11;
  1539. X+             finish(h);
  1540. X+             }
  1541. X          }
  1542. X      } else /*hit is off!*/
  1543. X      {
  1544. X***************
  1545. X*** 186,197 ****
  1546. X          if (t->whofrom!=NULL)
  1547. X              {
  1548. X              j=which_sector(t->xpos,t->ypos,0,0);
  1549. X!             if (j==2) gethim(t->whofrom,KLINGID);
  1550. X!             if (j==3) gethim(t->whofrom,ROMID);
  1551. X!             if (j==4) {
  1552. X!                   gethim(t->whofrom,ROMID);
  1553. X!                   gethim(t->whofrom,KLINGID);
  1554. X!                   }
  1555. X              }
  1556. X          if (c=='*')
  1557. X              {
  1558. X--- 228,254 ----
  1559. X          if (t->whofrom!=NULL)
  1560. X              {
  1561. X              j=which_sector(t->xpos,t->ypos,0,0);
  1562. X!         if (j==2 && t->whofrom->id!=ROMID && t->whofrom->id!=KLINGID) 
  1563. X!                 {
  1564. X!                 gethim(t->whofrom,KLINGID);
  1565. X!                 gethim(t->whofrom,KLINGID);
  1566. X!                 gethim(t->whofrom,KLINGID);
  1567. X!                 gethim(t->whofrom,KLINGID);
  1568. X!                 }
  1569. X!         if (j==3 && t->whofrom->id!=ROMID && t->whofrom->id!=KLINGID) 
  1570. X!                 {
  1571. X!                 gethim(t->whofrom,ROMID);
  1572. X!                 gethim(t->whofrom,ROMID);
  1573. X!                 gethim(t->whofrom,ROMID);
  1574. X!                 gethim(t->whofrom,ROMID);
  1575. X!                 }
  1576. X!         if (j==4 && t->whofrom->id!=ROMID && t->whofrom->id!=KLINGID) 
  1577. X!                 {
  1578. X!                 for (ll=1;ll<MAXALIENS;ll++)   
  1579. X!                     gethim(t->whofrom,ROMID);
  1580. X!                 for (ll=1;ll<MAXALIENS;ll++)   
  1581. X!                     gethim(t->whofrom,KLINGID);
  1582. X!                 }
  1583. X              }
  1584. X          if (c=='*')
  1585. X              {
  1586. X*** ../../mpss/files.h    Thu Jun 23 10:22:09 1988
  1587. X--- files.h    Wed Jul 27 14:36:10 1988
  1588. X***************
  1589. X*** 1,4 ****
  1590. X--- 1,5 ----
  1591. X  
  1592. X+ /********VERSION 1.4!!! (Files from different Versions are INCOMPATIBLE!*******/
  1593. X  /*******************************************************************************
  1594. X  ********************************************************************************
  1595. X  ********************************************************************************
  1596. X***************
  1597. X*** 13,19 ****
  1598. X  ********************************************************************************
  1599. X  *******************************************************************************/
  1600. X  
  1601. X- 
  1602. X  #define SLAVEPROGRAM "/usr/games/mpsslib/slave"
  1603. X  #define MASTERPROGRAM "/usr/games/mpsslib/startrek"
  1604. X  
  1605. X--- 14,19 ----
  1606. X***************
  1607. X*** 24,27 ****
  1608. X--- 24,28 ----
  1609. X  #define SCOREFILE "/usr/games/mpsslib/score"
  1610. X  #define PLAYERSCOREFILE "/usr/games/mpsslib/playerscore"
  1611. X  #define MAILFILE "/usr/games/mpsslib/mpssmail"
  1612. X+ #define PROCESSFILE "/tmp/processnos"
  1613. X  
  1614. X*** ../../mpss/header.h    Thu Jun 23 10:22:09 1988
  1615. X--- header.h    Wed Jul 27 14:36:10 1988
  1616. X***************
  1617. X*** 1,4 ****
  1618. X--- 1,5 ----
  1619. X  
  1620. X+ /********VERSION 1.4!!! (Files from different Versions are INCOMPATIBLE!*******/
  1621. X  /*******************************************************************************
  1622. X  ********************************************************************************
  1623. X  ********************************************************************************
  1624. X***************
  1625. X*** 22,28 ****
  1626. X  #define STARTENERGY 500 
  1627. X  #define STARTPHASER 15
  1628. X  #define STARTPHOTON 10
  1629. X! #define WEAPONREACH 6
  1630. X  #define PHOTONPOWER 60
  1631. X  #define PHASERPOWER 40
  1632. X  #define MAXWARP 1
  1633. X--- 23,29 ----
  1634. X  #define STARTENERGY 500 
  1635. X  #define STARTPHASER 15
  1636. X  #define STARTPHOTON 10
  1637. X! #define WEAPONREACH 8 
  1638. X  #define PHOTONPOWER 60
  1639. X  #define PHASERPOWER 40
  1640. X  #define MAXWARP 1
  1641. X***************
  1642. X*** 31,37 ****
  1643. X  #define OFF 0
  1644. X  #define ROMID 'R'
  1645. X  #define KLINGID 'K'
  1646. X! #define MAXALIENS 3
  1647. X  
  1648. X  
  1649. X  struct sgttyb params;
  1650. X--- 32,38 ----
  1651. X  #define OFF 0
  1652. X  #define ROMID 'R'
  1653. X  #define KLINGID 'K'
  1654. X! #define MAXALIENS 6
  1655. X  
  1656. X  
  1657. X  struct sgttyb params;
  1658. X***************
  1659. X*** 100,105 ****
  1660. X--- 101,107 ----
  1661. X      int xvel;
  1662. X      int yvel;
  1663. X      int maxvel;
  1664. X+     int screenenergy;
  1665. X      int energy;
  1666. X      int maxenergy;
  1667. X      int cloakingdevice;
  1668. X*** ../../mpss/planets.h    Thu Jun 23 10:22:09 1988
  1669. X--- planets.h    Wed Jul 27 14:36:10 1988
  1670. X***************
  1671. X*** 1,4 ****
  1672. X--- 1,5 ----
  1673. X  
  1674. X+ /********VERSION 1.4!!! (Files from different Versions are INCOMPATIBLE!*******/
  1675. X  /*******************************************************************************
  1676. X  ********************************************************************************
  1677. X  ********************************************************************************
  1678. X*** ../../mpss/ships.h    Thu Jun 23 10:22:09 1988
  1679. X--- ships.h    Wed Jul 27 14:36:10 1988
  1680. X***************
  1681. X*** 1,4 ****
  1682. X--- 1,5 ----
  1683. X  
  1684. X+ /********VERSION 1.4!!! (Files from different Versions are INCOMPATIBLE!*******/
  1685. X  /*******************************************************************************
  1686. X  ********************************************************************************
  1687. X  ********************************************************************************
  1688. END_OF_FILE
  1689. if test 48433 -ne `wc -c <'Patches01'`; then
  1690.     echo shar: \"'Patches01'\" unpacked with wrong size!
  1691. fi
  1692. # end of 'Patches01'
  1693. fi
  1694. echo shar: End of shell archive.
  1695. exit 0
  1696.